package tests;

import java.io.IOException;
import java.net.UnknownHostException;

import junit.framework.TestCase;
import tests.socketoutputstream.Client;
import tests.socketoutputstream.Server;

public class SOSTest extends TestCase {
	
	public void test1() {
		try {
			Server server=new Server();
			Thread t=new Thread(server);
			t.start();
			
			Client c=new Client();	
			String serverResponse=c.write("Hola");
			c.close();
			assertTrue(server.receivedString.equals("Hola"));
			System.out.println(serverResponse);
		} catch (UnknownHostException e) {
			fail();
		} catch (IOException e) {
			fail(e.toString());
		}
	}
}
